package com.neuedu.androidserver.controller;


import com.neuedu.androidserver.entity.Concat;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

@RestController
@RequestMapping("/concat")
public class ConcatController {
    String[] concatNames = {"张飞", "刘备", "诸葛亮", "孙权", "孙尚香", "黄月英1"};
    String[] concatTypes = {"成人", "学生", "老人"};

    /**
     * @return
     */
    @RequestMapping("/list")
    public ArrayList<Concat> list() {
        ArrayList<Concat> data = new ArrayList<>();

        Random rnd = new Random();
        for (int i = 0; i < concatNames.length; i++) {
            String concatName = concatNames[i];
            Concat concat = new Concat();
            concat.setId(i + "");
            concat.setConcatType(concatTypes[rnd.nextInt(3)]);
            concat.setConcatName(concatName+"boot" + "(" + concat.getConcatType() + ")");
            concat.setConcatIdNo("身份证:" + Math.abs(rnd.nextLong()));
            concat.setConcatPhone("电话:" + System.currentTimeMillis() + i);
            data.add(concat);
        }


        return data;
    }


}
